home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
BASIC
/
LIB
/
EVENTSHELL
/
DOCS
/
Menus
< prev
next >
Wrap
Text File
|
1996-05-18
|
15KB
|
604 lines
PROCshell_AttachMenu()
=> int window handle
int icon handle
int item handle
bool shift flag (not implemented)
bool ctrl flag (not implemented)
bool alt flag (not implemented)
The shift, ctrl and alt flags are for future
enhancements to the library and should be set
to 0 on this release.
If the menu is attached to an icon (rather than
a window work area) a click with SELECT or MENU
will open the menu. Also the button type of the
icon is changed to 3 (click) to ensure the menu
pops up when SELECT is used.
User FN (PROCshell_AttachMenu)
=> str text of menu selection
The function to call when the user makes
a choice from the menu.
--------------------------------------------------------
PROCshell_AttachMenuMaker()
=> int window handle
int icon handle
str function name
Registers a function to be called before the
menu is opened, allowing ticking, shading etc
of menu items.
User FN (PROCshell_AttachMenuMaker)
=> int window handle over which MENU
was pressed
int icon handle over which MENU was
pressed (-1 for no icon)
This function is called before the menu is
opened.
--------------------------------------------------------
PROCshell_AttachFontMenu()
=> int item handle
str function to call when menu_select
event occurs (optional, may be "")
Use this routine to attach the FontMenu to an icon or
a window. Attach the FontMenu to an existing menu
structure with PROCshell_AttachFontSubMenu.
This routine will attempt to load the necessary
'FontMenu' support module if it is not already
loaded. It expects to find it in the
EvntShell$Path (usually inside !EvntShell).
User FN (PROCshell_AttachFontMenu)
=> str selection string
<= int ignored
This function can be used to discover the name
of the font (if any) that has been selected in
the FontMenu. Use FNshell_FontMenuGetLastSelectedFont
for this.
--------------------------------------------------------
FNshell_FontMenuGetLastSelectedFont
=> None
<= str font name (could be "")
This routine should be used in the function
called when a menu_select event has occurred to
discover if font menu selection has been made,
and if so the name of the font.
If no valid font menu selection has been made
the function will return "" and no action should
be taken.
--------------------------------------------------------
PROCshell_FontMenuSelectFont()
=> str name of font to select
The font name is used by the library routines
to decide which font name to select when the
font menu opens. As the same font menu can be
used by different applications it is important
to set this up just before the menu opens.
--------------------------------------------------------
PROCshell_AttachMenuDBox()
=> int menu item handle
str window identifier
str function name
str function name
Calling this routine will automatically setup the sub
menu arrow on the menu item, and also set the 'menu
warning' flag. It is not necessary to do this in the
menu editor.
User FN (PROCshell_AttachMenuDBox)
=> int window handle
The function to call after creating the window
but before opening it. This can be used to fill
in icon fields etc. A function name of "" may
be used if you don't need to call a function.
User FN (PROCshell_AttachMenuDBox)
=>int window handle
The function to call after opening the window.
A function name of "" may be used if you don't
need to call a function.
--------------------------------------------------------
PROCshell_OpenMenu()
=> int menu x coordinate
int menu y coordinate
int handle of menu to open
Normally this routine is called internally
by the library routines in response to menu
open events set up by PROCshell_AttachMenu.
In some circumstances it may be advantageous
to call it from the user applications.
Note that this routine checks the last window/
icon pair clicked over and assumes that the
menu is attached to these. If you open the
menu in response to a click on the iconbar
icon the Y coordinate will be ignored. In
general you should always attach menus to
windows or window/icon pairs rather than using
this call.
--------------------------------------------------------
FNshell_MenuLastXPos
Returns the X coordinate of the last menu
opened by PROCshell_OpenMenu.
--------------------------------------------------------
FNshell_MenuLastYPos
Returns the Y coordinate of the last menu
opened by PROCshell_OpenMenu.
--------------------------------------------------------
PROCshell_MenuShade()
=> int menu or item handle
int state
Shades menu items. If a menu handle is
given then all items in the menu are
shaded or deshaded.
Menu Shade States
The state is 0 for no shading, non 0 for shading.
--------------------------------------------------------
PROCshell_MenuShadeAllItems()
=> int menu handle
Shades all the menu items in the specified menu
--------------------------------------------------------
PROCshell_MenuUnshadeAllItems()
=> int menu handle
Unshades all the menu items in the specified menu
--------------------------------------------------------
PROCshell_MenuTick()
=> int menu or item handle
int state
Adds or removes ticks for menu
items. If a menu handle is given
then all items in the menu are
ticked or not ticked.
See also PROCshell_MenuTickOnly1,
PROCshell_MenuTickOnly2
Menu Tick States
The state is 0 for no tick, non 0 for a tick.
--------------------------------------------------------
PROCshell_MenuTickAllItems()
=> int menu handle
Adds ticks to every item in the specified menu
See also PROCshell_MenuTickOnly1,
PROCshell_MenuTickOnly2
PROCshell_MenuUntickAllItems
--------------------------------------------------------
PROCshell_MenuUntickAllItems()
=> int menu handle
Removes ticks from every item in the specified menu
See also PROCshell_MenuTickOnly1,
PROCshell_MenuTickOnly2
PROCshell_MenuTickAllItems
--------------------------------------------------------
PROCshell_MenuPutData()
=> int menu item handle or menu handle
str data to write into menu item
This routine is used to alter the items of a
menu when the program runs. The width of the
menu is adjusted automatically.
If a menu handle is passed to this routine the
title is changed, but it is clearer to use the
call to PROCshell_MenuPutTitle.
--------------------------------------------------------
PROCshell_MenuPutTitle()
=> int menu handle
str title
The menu title is truncated to 12 characters, but no
error occurs.
--------------------------------------------------------
PROCshell_AttachSubMenu()
=> int item handle
int submenu menu handle
str function to call when menu_warning
message is received (optional, may
be "")
User FN (PROCshell_AttachSubMenu)
=> int window handle
int icon handle
<= int junk
--------------------------------------------------------
PROCshell_AttachFontSubMenu()
=> int item handle
str function to call when menu_warning
message is received (optional, may
be "")
This routine will attempt to load the necessary
'FontMenu' support module if it is not already
loaded. It expects to find it in the
EvntShellSystem$Path (usually in !EvntShell).
User FN (PROCshell_AttachFontSubMenu)
=> int window handle
int icon handle
<= int junk
This function can be used to set the currently
selected font in the menu about to be opened.
Use PROCshell_FontMenuSelectFont to do this.
--------------------------------------------------------
PROCshell_MenuWritable()
=> int menu or menu item handle
int state
int size of indirected buffer
str validation string
Makes the given menu item writable or non writable
depending on the state parameter. If a menu handle
is given then all items in the menu are made
writable or non writable.
MenuWritable States
The state is 0 for non writable, non 0
for writable.
--------------------------------------------------------
PROCshell_MenuDotted()
=> int menu or menu item handle
int state
Adds or removes a dotted line from below
the given menu item. If a menu handle is
given instead all items in the menu are
effected.
MenuDotted States
The state is 0 for non writable, non 0
for writable.
--------------------------------------------------------
FNshell_MenuNew()
=> str menu title (11 characters max)
str menu identifier (for
future use)
int nr of items in this menu
(approximate only, needed
to overcome a MenuUtils bug)
<= int menu handle
Creates a new menu with the given title.
--------------------------------------------------------
FNshell_MenuAdd()
=> int menu or menu item handle
str text for menu item
str fn to call when item is selected
<= int menu item handle
Adds a new item to an existing menu. If a menu
handle is given then the new item is added to
the end of the menu, if an item handle is given
the new item is added before the existing item.
User FN (FNshell_MenuAdd)
=> int menu decode block
Menu decode block
blk+00 position of selected menu item in menu
(starting from 0)
blk+04 pointer to selected item data
blk+08 selected item handle or zero if item
was created without MenuUtils
blk+12 pointer to text string of selected item
blk+16 position of parent menu item in menu
(starting from 0)
blk+20 pointer to parent item data
blk+24 parent item handle or zero if item was
created without MenuUtils
blk+28 pointer to text string of parent item
--------------------------------------------------------
PROCshell_MenuTickOnly1()
=> int menu handle
int position of item in menu
Ticks only the item given by the menu handle
and the position of the item. This call is
provided for when you don't know the handle
of the menu item.
See also PROCshell_MenuTickOnly2
--------------------------------------------------------
PROCshell_MenuTickOnly2()
=> int menu item handle
Ticks only the item given by the menu item
handle.
See also PROCshell_MenuTickOnly1
--------------------------------------------------------
PROCshell_MenuColours()
=> int menu item handle
int foreground colour (0-15)
int background colour (0-15)
Sets the foreground and background colours
of the item given. Note that the default
colours are set out in the Style Guide.
--------------------------------------------------------
FNshell_MenuMakeFromFile()
=> str menu title
str menu identifier (for future use)
str menu selection function
str full file name of command
file
<= int menu handle
Creates a new menu with the given title,
taking the menu items from the specified
menu command file.
The command file consists of menu text items,
blank lines and lines starting with a '#'
character are ignored.
Example Command File..
Adachi
Fuji HQ
Panasonic HQ
Sony
--------------------------------------------------------
PROCshell_MenuSortItems()
=> int menu handle
str comparision function (optional,
may be "")
bool ascending flag, non 0 for
ascending sort, 0 for
descending sort
int first item number to sort
(normally 0)
int last item number to sort
This routine is used to sort the menu items
into order. It should not be used if the items
do not have the same handler routine, as only
the menu text is moved around.
If a last item number is given that exceeds
the number of items in the menu it is reset
to be equal to the number of items.
If the comparision function is "" then a default
one is used which retrieves the menu items as
strings and compares them.
Comparision FN (PROCshell_MenuSortItems)
=> int first element nr
int second element nr
<= bool TRUE if value of first element
is less than the second,
otherwise FALSE
--------------------------------------------------------
PROCshell_AttachColourPopupMenu()
=> int window handle
int menu icon handle
int display icon handle
int menu handle
str user function (optional)
str preopen function (optional)
Provides for automatic updating of a display
icon when a selection is made from the
attached colour menu. If a user function name
is not supplied then the display icon shows
the selected menu item background colour.
The button type of the menu icon is changed
to 3 to ensure the menu opens when <SELECT>
is used.
User FN (AttachColourPopupMenu)
=> int window handle
int display icon handle
str menu text of selected item
<= bool TRUE if display icon should be
automatically updated, FALSE
otherwise
Preopen FN (AttachColourPopupMenu)
=> int menu handle
--------------------------------------------------------
PROCshell_AttachPopupMenu()
=> window handle
int menu icon handle
int display icon handle (optional,
may be -1)
int menu handle
str user function (optional, may be "")
Provides for automatic updating of a display
icon when a selection is made from the
attached menu if a user function name is
not supplied.
The button type of the menu icon is changed
to 3 to ensure the menu opens when <SELECT>
is used.
User FN (AttachPopupMenu)
=> int window handle
int display icon handle
str menu text of selected item
<= bool TRUE if text should be inserted
in the display icon, FALSE
otherwise
--------------------------------------------------------
PROCshell_MenuDelete()
=>int menu or menu item handle
Deletes a menu item or a whole menu if
a menu handle is specified. Note that if
a menu is deleted any menu events are also
deleted - so if you are deleting and then
re-creating a menu you must also attach
the new menu again.
--------------------------------------------------------
FNshell_MenuGetItemHandle()
=> int menu handle
int address of menu selection block
<= int item handle
Returns 0 if item cannot be found, or if item belongs
to a menu that was not created with the MenuUtils module
It should normally not be necessary to use
this call as the item handle is returned
when the menu item is created (so store it
if you are likely to need it later!)
Menu Selection Block
the block contains :
0 Item in main menu selected.
4 Item in 1st submenu.
8 Item in 2nd submenu.
++ ++
Terminated by -1
A selection block is normally returned by
the wimp when a menu selection has been
made.
--------------------------------------------------------
FNshell_MenuGetItemHandler()
=> int menu handle
int item number
<= str item handler FN
--------------------------------------------------------
FNshell_MenuGetItemHeight()
=> int menu handle
<= int item height (os units)
--------------------------------------------------------
FNshell_MenuCalculateHeight()
=> int menu handle
<= int height of menu (OS units)
--------------------------------------------------------
FNshell_MenuGetItemText()
=> int menu handle
int item handle
<= str text of menu item
--------------------------------------------------------
FNshell_MenuGetNrDotted()
=> int menu handle
<= int nr of items that have a dotted line
under them
--------------------------------------------------------
FNshell_MenuGetNrItems()
=> int menu handle
<= int nr of items in menu
--------------------------------------------------------